package com.ruben.simpleboot

import com.ruben.simpleboot.pojo.po.UserInfo
import io.github.vampireachao.stream.plugin.mybatisplus.Database
import io.github.vampireachao.stream.plugin.mybatisplus.One
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest

@SpringBootTest
class UpdateTest {

    @Test
    fun testUpdate() {
        val userInfo = One.of(UserInfo::getId).eq(1L).query()
        userInfo.email = null
        Database.updateById(userInfo)
        Assertions.assertNull(One.of(UserInfo::getId).eq(1L).value { obj: UserInfo -> obj.email }.query())
    }

}